import java.util.Scanner;

public class Main4 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int xA = in.nextInt(), yA = in.nextInt(), xB = in.nextInt(), yB = in.nextInt(), xC = in.nextInt(), yC = in.nextInt();
        int v1 = in.nextInt(), d1 = in.nextInt();
        int v2 = in.nextInt(), d2 = in.nextInt();
        double t = 0.0;
        double xAB = func(xA, yA, xB, yB);
        double xAC = func(xA, yA, xC, yC);
        double xBC = func(xB, yB, xC, yC);
        if (v1 == v2 && d1 == d2) {
            System.out.println(-1);
        } else {
            // 0 a b c a    1 a c b a
            if (d1 == 0) {
                if (d2 == 0) {
                    if (v1 > v2) {
                        t = xAB / (v1 - v2);
                    } else {
                        t = (xBC + xAC) / (v2 - v1);
                    }
                } else {
                    t = xAB / (v1 + v2);
                }
            } else {
                if (d2 == 0) {
                    t = (xAC + xBC) / (v1 + v2);
                } else {
                    if (v1 > v2) {
                        t = (xAC + xBC) / (v1 - v2);
                    } else {
                        t = xAB / (v2 - v1);
                    }
                }
            }
            System.out.println(t);
        }

    }

    private static double func(int xA, int yA, int xB, int yB) {
        return Math.pow(Math.pow((xA - xB), 2) + Math.pow((yA - yB), 2), 0.5);
    }
}
